package com.app.service;

import com.app.model.AdminUserModel;
import com.app.vo.AdminUserVo;
import com.app.vo.DividedAdminUserInto;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;

public interface AdminUserService extends IService<AdminUserModel> {
    //查询管理员列表
    AdminUserVo getAdminList(Integer page,Integer limit,String keyword);
    AdminUserVo getAdminUser(Integer page, Integer limit,Integer roleId);

    //根据账号和密码查管理员用户对象
    AdminUserModel login(String username,String md5Password);
    //-------------------------------------------以上为项目初始化-------------------------------------------
    //-------------------------------------------以下为业务代码--------------------------------------------

    /**
     * 查询区域当前用户消费份额
     *
     * @param cityId   城市id
     * @param areaCode 区号
     * @return {@link DividedAdminUserInto}
     */
    DividedAdminUserInto queryRegionCurrentUserConsumptionShare(String cityId,String areaCode);


    /**
     * 为当前平台用户累积积分
     *
     * @param value 值
     * @return boolean
     */
    @Transactional(rollbackFor = Exception.class)
    boolean accumulatePointsForCurrentPlatformUser(Integer userId,String name,BigDecimal value);


    /**
     * 当前平台用户累积凭证
     *
     * @param pumpingType 抽成类型 1消费 2回退
     * @param userId      用户id
     * @param name        姓名
     * @param value       值
     * @return boolean
     */
    @Transactional(rollbackFor = Exception.class)
    boolean accumulatVoucherForCurrentPlatformUser(Integer pumpingType,Integer userId,String name,BigDecimal value);

}
